import request from "@/utils/request";

/**
 * 获取菜单和路由
 * @returns {AxiosPromise}
 */
// 获取路由
export const getRouters = () => {
    return request({
        url: '/system/getRouters',
        method: 'get'
    })
}

/**
 * 获取静态路由
 * @returns {Promise<unknown>}
 */
export const generaStaticMenu = ()=>{
    //侧边栏菜单
    const navList=[
        {
            id:1,
            name:"首页",
            icon:"shouye",
            routerName:"index",
            path:"/",
            component:"index",
            parentId:0,
            children:null
        },
        {
            id:3,
            name:"关于",
            icon:"guanyu",
            routerName:"about",
            component:"about",
            path:"about",
            parentId:0,
            children:[]
        }
    ]

    const res = {
        code:200,
        data:navList
    }
    return new Promise((resolve) => {
        //拿数据
        resolve(res)
    })
}

/**
 * 登出
 * @returns {AxiosPromise}
 */
export const logout= ()=>request({url:"/user/logout",method:'get'});
